﻿using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write("对以下双色球号码：1, 5, 8, 17, 21, 10, 26进行排序<br/>");
        int[] Sum = { 1, 5, 8, 17, 21, 10, 26 };
        for (int i = 0; i < Sum.Length - 1; i++)
        {
            for (int j = i + 1; j < Sum.Length; j++)
            {
                if (Sum[j] < Sum[i])
                {
                    int max = Sum[i];
                    Sum[i] = Sum[j];
                    Sum[j] = max;
                }
            }
        }
        Response.Write("排序后的结果如下：" + "<br/>");
        for (int d = 0; d < Sum.Length; d++)
            Response.Write("开出的双色球号码："+Sum[d].ToString() + "<br/>");

        /*
         int index = System.Array.IndexOf(Sum,1);找数组中元素返回索引
         */
    }
}
